package com.tsy.server.system.entity.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.tsy.server.manage.model.dto.DeviceDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

@Data
@ApiModel(description = "项目数据传输对象")
public class ProjectDTO {

    @ApiModelProperty(value = "项目ID", example = "1")
    private Long id;

    @NotBlank(message = "项目名称不能为空")
    @ApiModelProperty(value = "项目名称", required = true, example = "无人机巡检项目")
    private String name;

    @ApiModelProperty(value = "项目描述", example = "用于城市基础设施巡检")
    private String description;

    @NotNull(message = "是否允许加入不能为空")
    @ApiModelProperty(value = "是否允许加入", required = true, example = "1")
    private Integer joinAble;

    @ApiModelProperty(value = "截止日期", example = "2023-12-31 23:59:59")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deadline;

    @NotNull(message = "经度不能为空")
    @Digits(integer = 10, fraction = 4, message = "经度必须是数字")
    @ApiModelProperty(value = "经度", required = true, example = "116.404")
    private Double longitude;

    @NotNull(message = "纬度不能为空")
    @Digits(integer = 10, fraction = 4, message = "纬度必须是数字")
    @ApiModelProperty(value = "纬度", required = true, example = "39.915")
    private Double latitude;

    @ApiModelProperty(value = "项目人员列表", example = "[]")
    private List<ProjectUserDTO> projectUsers;

    @ApiModelProperty(value = "项目设备列表", example = "[]")
    private List<DeviceDTO> projectDevices;


}